package com.zcx.qshop.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.zcx.qshop.R;
import com.zcx.qshop.QSApplication;

/**
 * Created by Administrator on 2015/8/7 0007.
 */
public class WelcomeActivity extends QSActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        if(!isTaskRoot()) {

            Intent intent = this.getIntent();

            if(intent.hasCategory("android.intent.category.LAUNCHER") && intent.getAction().equals("android.intent.action.MAIN")) {

                this.finish();

                return;

            }

        }

        setContentView(R.layout.activity_welcome);

        new Handler(){

            @Override
            public void handleMessage(Message msg) {

                startVerifyActivity(QSApplication.QSPreferences.readIsGuide()? NavigationActivity.class:GuideActivity.class);

                finish();

            }

        }.sendEmptyMessageDelayed(0, 5000);

    }

}
